//
//  HKDetailsVC.m
//  YaoHeAPP
//
//  Created by xyh on 16/4/18.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "HKDetailsVC.h"
#import "Masonry.h"
#import "Controller.h"
#import "MyOrderData.h"
#import "MyorderDataList.h"
#import "TongYong.h"
#import "orderCell.h"
#import "DetaileButandLabelCell.h"
#import "orderHeaderView.h"
#import "moneybuyCV.h"
#import "NOstuDetailVC.h"
#import "GeneraldetailsVC.h"
#import "NSString+formatWithFloat.h"

#define screenWidth self.view.frame.size.width
#define screenHeight self.view.frame.size.height
#define bgVCcolor [UIColor colorWithRed:235.f/255.f green:235.f/255.f blue:244.f/255.f alpha:1]

@interface HKDetailsVC ()
{
    UIView *topview;//顶部两个列表
    NSMutableArray *arrayList;
    
    NSString *dingdanhaost;
    NSString *statusst;
    NSString *compayst;
    NSString *numst;
    
    float shifuMoney;//实付金额
    UILabel *shifuTextBootm;
    UILabel *shifuText;
    
    NSMutableArray *MoneytextArray;//费用
    
    NSMutableArray *timearray;//下单时间  下单账号  下单人
    
    //请求得来的数据
    float total_money;//订单总金额
    float delay_money;//延期贷款
    float delay_service_money;//延期服务费
    float service_money;//服务费
    NSString *_upaid_money;  //待付金额 = 延期货款+服务费
    float front_money;//定金
    NSString *front_money_time;  //定金支付时间
    float drayage_money; //短波费
    float out_house_money; // 出库费
    
    UIView  *bantouming;
    
}
@end

@implementation HKDetailsVC

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"HKDetailsVC"];
    
    [[self rdv_tabBarController] setTabBarHidden:YES animated:YES];
    
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"HKDetailsVC"];
    
    [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden=YES;
    
    self.view.backgroundColor=bgVCcolor;
    //加一个导航条
    UIView*navcBar=[[UIView alloc]init];
    navcBar.backgroundColor=[UIColor colorWithRed:90.f/255.f green:191.f/255.f blue:219.f/255.f alpha:1];
    [self.view addSubview:navcBar];
    [self.view bringSubviewToFront:navcBar];
    [navcBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(0);   make.left.offset(0);
        make.height.offset(140);  make.right.offset(0);
    }];
    //导航条标题
    UILabel*titleLabel=[[UILabel alloc]init];
    titleLabel.text=@"待还款订单";
    titleLabel.font=Font(17);
    titleLabel.textAlignment=NSTextAlignmentCenter;
    titleLabel.textColor=[UIColor whiteColor];
    [navcBar addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(25);
        make.left.offset(self.view.frame.size.width/2-70);
        make.width.offset(140);
        make.height.offset(30);
    }];
    
    //返回按钮
    UIButton*leftButton=[UIButton buttonWithType:UIButtonTypeCustom];
    [leftButton setBackgroundImage:[UIImage imageNamed:@"return"] forState:UIControlStateNormal];
    [leftButton addTarget:self action:@selector(backLogin) forControlEvents:UIControlEventTouchUpInside];
    [navcBar addSubview:leftButton];
    [leftButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(6);
        make.width.offset(24);
        make.height.offset(22);
        make.top.offset(31);
    }];
    
    //顶部数组
    
    //中间线长度
    NSInteger online=(screenWidth-(30*3)-(40*2))/2;
    NSInteger jianju=(screenWidth-(60*3)-(25*2))/2;
    NSInteger yuanWandH=30;
    NSArray *topArray=@[@"确认订单",@"支付订单",@"已结算"];
    for (int i=0; i<topArray.count; i++) {
        UILabel *yuan=[[UILabel alloc]init];
        yuan.frame=CGRectMake(40+(30+online)*i, 140-15-30-10-20, yuanWandH, yuanWandH);
        yuan.layer.masksToBounds=YES;
        yuan.text=[NSString stringWithFormat:@"%d",i+1];
        yuan.textAlignment=NSTextAlignmentCenter;
        yuan.textColor=[UIColor whiteColor];
        yuan.tag=10+i;
        yuan.layer.cornerRadius=15;
        [navcBar addSubview:yuan];
        
        UILabel *toplable=[[UILabel alloc]init];
        toplable.frame=CGRectMake(25+(60+jianju)*i, 140-15-30-10-20+30+5, 60, 30);
        toplable.text=topArray[i];
        toplable.textAlignment=NSTextAlignmentCenter;
        toplable.font=[UIFont systemFontOfSize:14];
        toplable.textColor=[UIColor whiteColor];
        toplable.tag=100+i;
        
        if (i==0||i==1) {
            
            yuan.backgroundColor=[UIColor colorWithRed:146.f/255.f green:198.f/255.f blue:35.f/255.f alpha:1];
            yuan.alpha=1;
            
            toplable.alpha=1;
        }else{
            yuan.backgroundColor=[UIColor colorWithRed:91.f/255.f green:140.f/255.f blue:152.f/255.f alpha:0.5];
            yuan.alpha=0.5;
            
            toplable.alpha=0.5;
        }
        
        [navcBar addSubview:toplable];
        
        
    }
    
    for (int j=0; j<topArray.count-1; j++) {
        
        UIImageView *onlineimg=[[UIImageView alloc]init];
        
        if (j==0) {
            onlineimg.backgroundColor=[UIColor colorWithRed:146.f/255.f green:198.f/255.f blue:35.f/255.f alpha:1];
        }else{
            onlineimg.backgroundColor=[UIColor colorWithRed:91.f/255.f green:140.f/255.f blue:152.f/255.f alpha:0.5];
        }
        
        onlineimg.frame=CGRectMake(40+yuanWandH*(j+1)+online*j, 140-15-30-10-20+15, online, 1);
        [navcBar addSubview:onlineimg];
        
    }
    
    
    //请求数据
    [self upHKdata];
    
    
    
}
//请求还款数据
-(void)upHKdata
{

    //获取
    NSMutableDictionary *di=[[NSMutableDictionary alloc]init];
    [di setValue:@"" forKey:@"member_id"];
    [di setValue:self.order_ids forKey:@"order_ids"];
    //要判断什么类型的然后穿的参数不同
    
    [Controller requestWithURL:RefundOrdersDetail jsondic:di finishBlock:^(ClassData* data) {
        
        if ([data.number isEqualToNumber:[NSNumber numberWithInteger:0]])
        {
//            "delay_money" = "443.08";
//            "delay_service_money" = "0.89";
//            "drayage_money" = 0;
//            "front_money" = "49.23";
//            "front_money_time" = "2016-03-22";
//            "out_house_money" = 0;
//            "service_money" = "0.89";
//            "total_money" = "492.31";
//            "upaid_money" = "443.97";
            
            NSString  *total_moneyst=data.data[@"total_money"];
            total_money=total_moneyst.floatValue;
            
            NSString  *delay_moneyst=data.data[@"delay_money"];
            delay_money=delay_moneyst.floatValue;
            
            NSString  *delay_service_moneyst=data.data[@"delay_service_money"];
            delay_service_money=delay_service_moneyst.floatValue;
           
            
            NSString  *service_moneyst=data.data[@"service_money"];
            service_money=service_moneyst.floatValue;
            
            
            NSString *upaid_moneyst = [NSString stringWithFormat:@"%@", data.data[@"upaid_money"]];
            NSDecimalNumber *unPaidNumber = [[NSDecimalNumber alloc] initWithString:upaid_moneyst];
            _upaid_money = [NSString notRounding:unPaidNumber afterPoint:2];
            
            NSString  *front_moneyst=data.data[@"front_money"];
            front_money=front_moneyst.floatValue;
            
            
            front_money_time=data.data[@"front_money_time"];
            
            
            
            NSString  *drayage_moneyst=data.data[@"drayage_money"];
            drayage_money=drayage_moneyst.floatValue;
            
            
            NSString  *out_house_moneyst=data.data[@"out_house_money"];
            out_house_money=out_house_moneyst.floatValue;
            
            //布置页面
            [self upselfView];
            
            
        }else
        {
            ALERTSHOW(data.message);
            
            
        }
    }];

    
    
    


}

-(void)upselfView
{

    //订单号   公司名称
    topview =[[UIView alloc]initWithFrame:CGRectMake(0, 140, screenWidth, 180)];
    topview.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:topview];
    
    //订单名称和订单号
    UILabel  *companyorderlabel=[[UILabel alloc]initWithFrame:CGRectMake(10, 11, 165, 20)];
    companyorderlabel.textAlignment=NSTextAlignmentLeft;
    companyorderlabel.font=[UIFont systemFontOfSize:12];
    companyorderlabel.tag=9000;
    companyorderlabel.text=[NSString stringWithFormat:@"合计金额(元):%.2f",total_money];
    [topview addSubview:companyorderlabel];
    
    //状态
    UILabel  *statusla=[[UILabel alloc]initWithFrame:CGRectMake(screenWidth-100-10, 11, 100, 20)];
    statusla.textAlignment=NSTextAlignmentRight;
    statusla.font=[UIFont systemFontOfSize:12];
    statusla.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    statusla.tag=9001;
    statusla.text=[NSString stringWithFormat:@"共%@个订单",self.num];
    [topview addSubview:statusla];
    
    UIImageView *line=[[UIImageView alloc]initWithFrame:CGRectMake(0, 42, self.view.frame.size.width, 1)];
    line.backgroundColor=[UIColor colorWithRed:230/255.0 green:232/255.0 blue:241/255.0  alpha:1];
    [topview addSubview:line];
    
    
    UIImageView *box=[[UIImageView alloc]initWithFrame:CGRectMake((screenWidth-105)/2-2, 56, 18, 16)];
    box.image=[UIImage imageNamed:@"daihuankuanbox"];
    [topview addSubview:box];
    //全部待还（元）
    UILabel  *comlabel=[[UILabel alloc]initWithFrame:CGRectMake((screenWidth-105)/2+20, 53, 105, 20)];
    comlabel.textAlignment=NSTextAlignmentLeft;
    comlabel.font=[UIFont systemFontOfSize:15];
    comlabel.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    comlabel.text=@"全部待还(元)";
    [topview addSubview:comlabel];
    
    //中间金额
    UILabel  *numla=[[UILabel alloc]initWithFrame:CGRectMake(10, 78, screenWidth-20, 32)];
    numla.textAlignment=NSTextAlignmentCenter;
    numla.font=[UIFont systemFontOfSize:30];
    numla.textColor=[UIColor blackColor];
    numla.text=[NSString stringWithFormat:@"%@", _upaid_money];
    [topview addSubview:numla];
    
    UILabel  *baohan=[[UILabel alloc]initWithFrame:CGRectMake(10, 115, (screenWidth-20), 20)];
    baohan.textAlignment=NSTextAlignmentCenter;
    baohan.font=[UIFont systemFontOfSize:13];
    baohan.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    baohan.text=@"包含:延期货款+服务费";
    [topview addSubview:baohan];
    
    
    UIImageView *line2=[[UIImageView alloc]initWithFrame:CGRectMake(0, 140, self.view.frame.size.width, 1)];
    line2.backgroundColor=[UIColor colorWithRed:230/255.0 green:232/255.0 blue:241/255.0  alpha:1];
    [topview addSubview:line2];
    
    //竖线分割线
    UIImageView *line3=[[UIImageView alloc]initWithFrame:CGRectMake(screenWidth/2-0.25, 145, 1, 30)];
    line3.backgroundColor=[UIColor colorWithRed:230/255.0 green:232/255.0 blue:241/255.0  alpha:1];
    [topview addSubview:line3];
    
    
    UILabel  *yanqi=[[UILabel alloc]initWithFrame:CGRectMake(0, 150, screenWidth/2-0.5, 20)];
    yanqi.textAlignment=NSTextAlignmentCenter;
    yanqi.font=[UIFont systemFontOfSize:13];
    yanqi.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    [topview addSubview:yanqi];
    NSString *yanst=[NSString stringWithFormat:@"延期货款(元):%.2f",delay_money];
    NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:yanst];
    NSRange redRange = NSMakeRange([[noteStr string] rangeOfString:@":"].location+1,noteStr.length-8 );
    [noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:redRange];
    [yanqi setAttributedText:noteStr] ;
    
    
    UILabel  *fuwu=[[UILabel alloc]initWithFrame:CGRectMake(screenWidth/2+0.5, 150, screenWidth/2-0.5, 20)];
    fuwu.textAlignment=NSTextAlignmentCenter;
    fuwu.font=[UIFont systemFontOfSize:13];
    fuwu.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    [topview addSubview:fuwu];
    NSString *fust=[NSString stringWithFormat:@"服务费(元):%.2f",service_money];
    NSMutableAttributedString *noteStrfu = [[NSMutableAttributedString alloc] initWithString:fust];
    NSRange redRangefu = NSMakeRange([[noteStrfu string] rangeOfString:@":"].location+1,noteStrfu.length-7 );
    [noteStrfu addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:redRangefu];
    [fuwu setAttributedText:noteStrfu] ;
    
    
    
    
    UILabel  *mingxi=[[UILabel alloc]initWithFrame:CGRectMake(10, 330, (screenWidth-20), 20)];
    mingxi.textAlignment=NSTextAlignmentLeft;
    mingxi.font=[UIFont systemFontOfSize:13];
    mingxi.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    mingxi.text=@"账单明细:";
    [self.view addSubview:mingxi];
    
    //下面Cellview1
    UIView *cellview=[[UIView alloc]initWithFrame:CGRectMake(0, 355, screenWidth, 40)];
    cellview.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:cellview];
    
    UIImageView *title1=[[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 20, 20)];
    title1.image=[UIImage imageNamed:@"biaoqian1"];
    [cellview addSubview:title1];
    
    UILabel  *dinjin=[[UILabel alloc]initWithFrame:CGRectMake(35, 8, 90, 20)];
    dinjin.textAlignment=NSTextAlignmentLeft;
    dinjin.font=[UIFont systemFontOfSize:13];
    dinjin.textColor=[UIColor blackColor];
    dinjin.text=@"10%定金(元)";
    [cellview addSubview:dinjin];
    
    UIButton *but1=[[UIButton alloc]initWithFrame:CGRectMake(115, 11, 15, 15)];
    [but1 setImage:[UIImage imageNamed:@"wenhao"] forState:UIControlStateNormal];
    [but1 addTarget:self action:@selector(but1Action) forControlEvents:UIControlEventTouchUpInside];
    [cellview addSubview:but1];
    
    
    
    UILabel  *zhifutime=[[UILabel alloc]initWithFrame:CGRectMake(35, 28, 90, 10)];
    zhifutime.textAlignment=NSTextAlignmentLeft;
    zhifutime.font=[UIFont systemFontOfSize:9];
    zhifutime.textColor=[UIColor colorWithRed:149/255.0 green:149/255.0 blue:149/255.0  alpha:1];
    zhifutime.text=[NSString  stringWithFormat:@"%@ 支付",front_money_time];
    [cellview addSubview:zhifutime];
    
    
    UILabel  *feiyong=[[UILabel alloc]initWithFrame:CGRectMake(screenWidth-100-10, 10, 100, 20)];
    feiyong.textAlignment=NSTextAlignmentRight;
    feiyong.font=[UIFont systemFontOfSize:12];
    feiyong.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    feiyong.text=[NSString stringWithFormat:@"%.2f",front_money];
    [cellview addSubview:feiyong];
    
    UIImageView *line8=[[UIImageView alloc]initWithFrame:CGRectMake(10, 39, self.view.frame.size.width, 1)];
    line8.backgroundColor=[UIColor colorWithRed:230/255.0 green:232/255.0 blue:241/255.0  alpha:1];
    [cellview addSubview:line8];
    
    
    
    //下面Cellview2
    UIView *cellview2=[[UIView alloc]initWithFrame:CGRectMake(0, 395, screenWidth, 40)];
    cellview2.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:cellview2];
    
    UIImageView *title2=[[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 20, 20)];
    title2.image=[UIImage imageNamed:@"biaoqian2"];
    [cellview2 addSubview:title2];
    
    UILabel  *dinjin2=[[UILabel alloc]initWithFrame:CGRectMake(35, 8, 90, 20)];
    dinjin2.textAlignment=NSTextAlignmentLeft;
    dinjin2.font=[UIFont systemFontOfSize:13];
    dinjin2.textColor=[UIColor blackColor];
    dinjin2.text=@"待还金额(元)";
    [cellview2 addSubview:dinjin2];
    
    UIButton *but2=[[UIButton alloc]initWithFrame:CGRectMake(115, 11, 15, 15)];
    [but2 setImage:[UIImage imageNamed:@"wenhao"] forState:UIControlStateNormal];
    [but2 addTarget:self action:@selector(but2Action) forControlEvents:UIControlEventTouchUpInside];
    [cellview2 addSubview:but2];
    
    UILabel  *zhifutime2=[[UILabel alloc]initWithFrame:CGRectMake(35, 28, 90, 10)];
    zhifutime2.textAlignment=NSTextAlignmentLeft;
    zhifutime2.font=[UIFont systemFontOfSize:9];
    zhifutime2.textColor=[UIColor colorWithRed:149/255.0 green:149/255.0 blue:149/255.0  alpha:1];
    zhifutime2.text=@"未支付";
    [cellview2 addSubview:zhifutime2];
    
    
    UILabel  *feiyong2=[[UILabel alloc]initWithFrame:CGRectMake(screenWidth-100-10, 10, 100, 20)];
    feiyong2.textAlignment=NSTextAlignmentRight;
    feiyong2.font=[UIFont systemFontOfSize:12];
    feiyong2.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    feiyong2.text=[NSString stringWithFormat:@"%@", _upaid_money];
    [cellview2 addSubview:feiyong2];
    
    
    
    //下部按钮
    UIView *bootmView=[[UIView alloc]init];
    bootmView.backgroundColor=[UIColor whiteColor];
    bootmView.frame=CGRectMake(0,screenHeight-40, screenWidth, 40);
    [self.view addSubview:bootmView];
    
    //结算
    UIButton *tijiaoBUt=[[UIButton alloc]initWithFrame:CGRectMake(self.view.frame.size.width-80,1, 80, 39)];
    tijiaoBUt.backgroundColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    [tijiaoBUt setTitle:@"去付款" forState:UIControlStateNormal];
    tijiaoBUt.titleLabel.font=[UIFont systemFontOfSize:14];
    [tijiaoBUt setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [tijiaoBUt addTarget:self action:@selector(qufukuanBUtAction) forControlEvents:UIControlEventTouchUpInside];
    [bootmView addSubview:tijiaoBUt];
    
    //实付款
    shifuTextBootm=[[UILabel alloc]initWithFrame:CGRectMake(10, 10, screenWidth-80-10, 20)];
    shifuTextBootm.font=[UIFont systemFontOfSize:15];
    shifuTextBootm.textAlignment=NSTextAlignmentLeft;
    shifuTextBootm.textColor=[UIColor blackColor];
    [bootmView addSubview:shifuTextBootm];
    //指定位置变色
    shifuMoney=4800;
    NSString *ss = [NSString stringWithFormat:@"全部待还:￥%@元", _upaid_money];
    NSMutableAttributedString *noteStrshi = [[NSMutableAttributedString alloc] initWithString:ss];
    NSRange redRangeshi = NSMakeRange([[noteStrshi string] rangeOfString:@":"].location+1,noteStrshi.length-5 );
    [noteStrshi addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:redRangeshi];
    [shifuTextBootm setAttributedText:noteStrshi];
}

//第一个问号
-(void)but1Action
{
  
    bantouming=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    bantouming.backgroundColor = [UIColor colorWithRed:(40/255.0f) green:(40/255.0f) blue:(40/255.0f) alpha:0.6f];
    bantouming.alpha =1;
    [self.view addSubview:bantouming];
    [self.view bringSubviewToFront:bantouming];

    UIView *bigfristview=[[UIView alloc]initWithFrame:CGRectMake((screenWidth-210)/2, (screenHeight-140)/2, 210, 140)];
    bigfristview.layer.cornerRadius=10;
    bigfristview.backgroundColor=[UIColor whiteColor];
    [bantouming addSubview:bigfristview];
    
    
//    UIButton *bt=[[UIButton alloc]init];
//    bt.frame=CGRectMake(210-25, 5, 20, 20);
//    bt.backgroundColor=[UIColor clearColor];
//    [bt setBackgroundImage:[UIImage imageNamed:@"ic_close_imageviewer"] forState:UIControlStateNormal];
//    [bt addTarget:self action:@selector(remTitfrist) forControlEvents:UIControlEventTouchUpInside];
//    [bigfristview addSubview:bt];
    
    UILabel  *qishufrist=[[UILabel alloc]initWithFrame:CGRectMake((210-100)/2, 10, 100, 20)];
    qishufrist.textAlignment=NSTextAlignmentCenter;
    qishufrist.font=[UIFont systemFontOfSize:15];
    qishufrist.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    qishufrist.text=@"第1/2期";
    [bigfristview addSubview:qishufrist];

    UILabel  *huokuanfrist=[[UILabel alloc]initWithFrame:CGRectMake(10, 40, 90, 20)];
    huokuanfrist.textAlignment=NSTextAlignmentLeft;
    huokuanfrist.font=[UIFont systemFontOfSize:13];
    huokuanfrist.textColor=[UIColor blackColor];
    huokuanfrist.text=@"10%货款(元):";
    [bigfristview addSubview:huokuanfrist];
    
    UILabel  *huokuan1=[[UILabel alloc]initWithFrame:CGRectMake(210-80, 40, 70, 20)];
    huokuan1.textAlignment=NSTextAlignmentRight;
    huokuan1.font=[UIFont systemFontOfSize:13];
    huokuan1.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    huokuan1.text=[NSString stringWithFormat:@"%.2f",front_money];
    [bigfristview addSubview:huokuan1];
    

    
    UILabel  *fuwufrist=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 90, 20)];
    fuwufrist.textAlignment=NSTextAlignmentLeft;
    fuwufrist.font=[UIFont systemFontOfSize:13];
    fuwufrist.textColor=[UIColor blackColor];
    fuwufrist.text=@"服务费(元):";
    [bigfristview addSubview:fuwufrist];

    
    UILabel  *huokuan2=[[UILabel alloc]initWithFrame:CGRectMake(210-80, 70, 70, 20)];
    huokuan2.textAlignment=NSTextAlignmentRight;
    huokuan2.font=[UIFont systemFontOfSize:13];
    huokuan2.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    huokuan2.text=[NSString stringWithFormat:@"0"];
    [bigfristview addSubview:huokuan2];
    
    UIImageView *line8=[[UIImageView alloc]initWithFrame:CGRectMake(0, 140-41, 210, 1)];
    line8.backgroundColor=[UIColor colorWithRed:193/255.0 green:193/255.0 blue:193/255.0  alpha:1];
    [bigfristview addSubview:line8];
    
    UIButton *wozhidaoBUt=[[UIButton alloc]initWithFrame:CGRectMake(0,140-40, 210, 40)];
    wozhidaoBUt.backgroundColor=[UIColor colorWithRed:236.f/255.f green:236.f/255.f blue:236.f/255.f alpha:1];
    [wozhidaoBUt setTitle:@"我知道了" forState:UIControlStateNormal];
    wozhidaoBUt.titleLabel.font=[UIFont systemFontOfSize:20];
    [wozhidaoBUt setTitleColor:[UIColor colorWithRed:90.f/255.f green:191.f/255.f blue:219.f/255.f alpha:1] forState:UIControlStateNormal];
    [wozhidaoBUt addTarget:self action:@selector(wozhidaoBUtAction) forControlEvents:UIControlEventTouchUpInside];
    [bigfristview addSubview:wozhidaoBUt];
   //指定部位为圆角
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:wozhidaoBUt.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = wozhidaoBUt.bounds;
    maskLayer.path = maskPath.CGPath;
    wozhidaoBUt.layer.mask = maskLayer;
    
    
    
}

//第二个问号
-(void)but2Action
{
    
    bantouming=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    bantouming.backgroundColor = [UIColor colorWithRed:(40/255.0f) green:(40/255.0f) blue:(40/255.0f) alpha:0.6f];
    bantouming.alpha =1;
    [self.view addSubview:bantouming];
    [self.view bringSubviewToFront:bantouming];
    
    UIView *bigtowview=[[UIView alloc]initWithFrame:CGRectMake((screenWidth-210)/2, (screenHeight-200)/2, 210, 200)];
    bigtowview.layer.cornerRadius=10;
    bigtowview.backgroundColor=[UIColor whiteColor];
    [bantouming addSubview:bigtowview];
    
    
    //    UIButton *bt=[[UIButton alloc]init];
    //    bt.frame=CGRectMake(210-25, 5, 20, 20);
    //    bt.backgroundColor=[UIColor clearColor];
    //    [bt setBackgroundImage:[UIImage imageNamed:@"ic_close_imageviewer"] forState:UIControlStateNormal];
    //    [bt addTarget:self action:@selector(remTitfrist) forControlEvents:UIControlEventTouchUpInside];
    //    [bigfristview addSubview:bt];
    
    UILabel  *qishufrist=[[UILabel alloc]initWithFrame:CGRectMake((210-100)/2, 10, 100, 20)];
    qishufrist.textAlignment=NSTextAlignmentCenter;
    qishufrist.font=[UIFont systemFontOfSize:15];
    qishufrist.textColor=[UIColor colorWithRed:135.f/255.f green:135.f/255.f blue:135.f/255.f alpha:1];
    qishufrist.text=@"第2/2期";
    [bigtowview addSubview:qishufrist];
    
    UILabel  *huokuanfrist=[[UILabel alloc]initWithFrame:CGRectMake(10, 40, 90, 20)];
    huokuanfrist.textAlignment=NSTextAlignmentLeft;
    huokuanfrist.font=[UIFont systemFontOfSize:13];
    huokuanfrist.textColor=[UIColor blackColor];
    huokuanfrist.text=@"90%货款(元):";
    [bigtowview addSubview:huokuanfrist];
    
    UILabel  *huokuan1=[[UILabel alloc]initWithFrame:CGRectMake(210-80, 40, 70, 20)];
    huokuan1.textAlignment=NSTextAlignmentRight;
    huokuan1.font=[UIFont systemFontOfSize:13];
    huokuan1.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    huokuan1.text=[NSString stringWithFormat:@"%.2f",delay_money];
    [bigtowview addSubview:huokuan1];
    
    
    
    UILabel  *fuwufrist=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 110, 20)];
    fuwufrist.textAlignment=NSTextAlignmentLeft;
    fuwufrist.font=[UIFont systemFontOfSize:13];
    fuwufrist.textColor=[UIColor blackColor];
    fuwufrist.text=@"延期服务费(元):";
    [bigtowview addSubview:fuwufrist];
    
    
    UILabel  *huokuan2=[[UILabel alloc]initWithFrame:CGRectMake(210-80, 70, 70, 20)];
    huokuan2.textAlignment=NSTextAlignmentRight;
    huokuan2.font=[UIFont systemFontOfSize:13];
    huokuan2.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    huokuan2.text=[NSString stringWithFormat:@"%.2f",delay_service_money];
    [bigtowview addSubview:huokuan2];
    
    
    UILabel  *chukufei=[[UILabel alloc]initWithFrame:CGRectMake(10, 100, 90, 20)];
    chukufei.textAlignment=NSTextAlignmentLeft;
    chukufei.font=[UIFont systemFontOfSize:13];
    chukufei.textColor=[UIColor blackColor];
    chukufei.text=@"出库费(元):";
    [bigtowview addSubview:chukufei];
    
    
    UILabel  *chukufeist=[[UILabel alloc]initWithFrame:CGRectMake(210-80, 100, 70, 20)];
    chukufeist.textAlignment=NSTextAlignmentRight;
    chukufeist.font=[UIFont systemFontOfSize:13];
    chukufeist.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    chukufeist.text=[NSString stringWithFormat:@"%.2f",out_house_money];
    [bigtowview addSubview:chukufeist];
    
    
    UILabel  *duanbofei=[[UILabel alloc]initWithFrame:CGRectMake(10, 130, 90, 20)];
    duanbofei.textAlignment=NSTextAlignmentLeft;
    duanbofei.font=[UIFont systemFontOfSize:13];
    duanbofei.textColor=[UIColor blackColor];
    duanbofei.text=@"短驳费(元):";
    [bigtowview addSubview:duanbofei];
    
    
    UILabel  *duanbofeist=[[UILabel alloc]initWithFrame:CGRectMake(210-80, 130, 70, 20)];
    duanbofeist.textAlignment=NSTextAlignmentRight;
    duanbofeist.font=[UIFont systemFontOfSize:13];
    duanbofeist.textColor=[UIColor colorWithRed:251.f/255.f green:87.f/255.f blue:60.f/255.f alpha:1];
    duanbofeist.text=[NSString stringWithFormat:@"%.2f",drayage_money];
    [bigtowview addSubview:duanbofeist];
    


    UIImageView *line8=[[UIImageView alloc]initWithFrame:CGRectMake(0, 200-41, 210, 1)];
    line8.backgroundColor=[UIColor colorWithRed:193/255.0 green:193/255.0 blue:193/255.0  alpha:1];
    [bigtowview addSubview:line8];
    
    UIButton *wozhidaoBUt=[[UIButton alloc]initWithFrame:CGRectMake(0,200-40, 210, 40)];
    wozhidaoBUt.backgroundColor=[UIColor colorWithRed:236.f/255.f green:236.f/255.f blue:236.f/255.f alpha:1];
    [wozhidaoBUt setTitle:@"我知道了" forState:UIControlStateNormal];
    wozhidaoBUt.titleLabel.font=[UIFont systemFontOfSize:20];
    [wozhidaoBUt setTitleColor:[UIColor colorWithRed:90.f/255.f green:191.f/255.f blue:219.f/255.f alpha:1] forState:UIControlStateNormal];
    [wozhidaoBUt addTarget:self action:@selector(wozhidaoBUtAction) forControlEvents:UIControlEventTouchUpInside];
    [bigtowview addSubview:wozhidaoBUt];
    //指定部位为圆角
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:wozhidaoBUt.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = wozhidaoBUt.bounds;
    maskLayer.path = maskPath.CGPath;
    wozhidaoBUt.layer.mask = maskLayer;

    
    
}

//隐藏第一个蒙版（我知道）
-(void)wozhidaoBUtAction
{
    [bantouming removeFromSuperview];


}


//去付款
-(void)qufukuanBUtAction
{
    [MobClick event:@"huankuanxiangqing_zhifu"];
    
    moneybuyCV *moneyvc=[[moneybuyCV alloc]init];
    moneyvc.pay_type=@"5";
    moneyvc.ordernum=self.ordernum;
    moneyvc.order_ids=self.order_ids;
    moneyvc.intent_order_id=self.intent_order_id;
    [self.navigationController pushViewController:moneyvc animated:YES];
    
}


-(void)backLogin
{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

@end
